#import <Foundation/Foundation.h>

#undef    AS_SINGLETON
#define AS_SINGLETON( __class ) \
+ (__class *)sharedInstance;

#undef    DEF_SINGLETON
#define DEF_SINGLETON( __class ) \
+ (__class *)sharedInstance \
{ \
static dispatch_once_t once; \
static __class * __singleton__; \
dispatch_once( &once, ^{ __singleton__ = [[__class alloc] init]; } ); \
return __singleton__; \
}


#define AppStateInstance [AppState sharedInstance]

//版本配置
typedef NS_ENUM(NSInteger,CC_APP_STATE)
{
    CC_APP_STATE_INIT = -1,// init value
    CC_APP_STATE_F,
    CC_APP_STATE_R,
    CC_APP_STATE_O
};


@interface AppState : NSObject
AS_SINGLETON(AppState)

@property (nonatomic,assign) CC_APP_STATE versionCode;

@end

